import pytest

from api.LoginAPI import loginApi
import sys
import os

# 添加项目根目录到 sys.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../../..")))


@pytest.fixture(scope="session")  # function
def login_fixture():
    l = loginApi()
    login = l.login("18292417675", "crmeb@123456")
    return login.json().get("data").get("token")  # 获取token
